package com.handsome.工厂模式.简单工厂模式.简单工厂模式写法2.factory;


import com.handsome.工厂模式.简单工厂模式.简单工厂模式写法2.pizza.CheesePizza;
import com.handsome.工厂模式.简单工厂模式.简单工厂模式写法2.pizza.GreekPizza;
import com.handsome.工厂模式.简单工厂模式.简单工厂模式写法2.pizza.Pizza;

/**
 * 简单工厂类
 *
 * @author niechun
 * @date 2023/1/8 20:02
 */
public class PizzaFactory {

    public static Pizza createPizza(String orderType) {

        Pizza pizza = null;
        if ("greek".equals(orderType)) {
            pizza = new GreekPizza("greek pizza");
        } else if ("cheese".equals(orderType)) {
            pizza = new CheesePizza("cheese pizza");
        }

        return pizza;
    }


}
